package cn.itcast.dao;

import cn.itcast.domain.delivery.Promotion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;

public interface PromotionRepository extends JpaRepository<Promotion,Integer> {
    @Query("update Promotion  set status =2 where endDate < ?1")
    @Modifying
    void updataStatus(Date now);
}
